package com.sg.service.biz.bff.impl;

import com.sg.common.util.CommonFunctionHelper;
import com.sg.common.util.RedisUtil;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.service.biz.bff.TimingTaskService;
import com.wicket.okrapp.integration.*;
import com.wicket.okrapp.integration.dto.*;
import com.sg.common.exception.Assert;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Service
public class TimingTaskServiceImpl implements TimingTaskService {

    @Resource
    private RedisUtil redisUtil;
    @Resource
    com.sg.service.biz.app.TimingTaskService fwAppTimingTaskClient;
    @Resource
    com.sg.service.biz.app.DivineDataService fwAppDivineDataClient;

    @Resource
    com.sg.service.biz.app.TaskService fwAppTaskClient;

    @Resource
    com.sg.service.biz.app.TargetCycleService fwAppTargetCycleClient;

    @Resource
    com.sg.service.biz.app.TaskGenService fwAppTaskGenClient;
    @Resource
    com.sg.service.biz.app.EvaThemeService fwAppEvaThemeClient;

    /**
     * B3-循环设定祖先目标父子状态（人工真实测试）[4656]
     * gen by moon at 9/22/2022, 1:09:20 AM
     */
    @Trace(operationName = "B3-循环设定祖先目标父子状态（人工真实测试）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffLoopSetTargetAncestorParentStateRespDto loopSetTargetAncestorParentState(BffLoopSetTargetAncestorParentStateReqDto reqDto) {


        //步骤0: D3-11循环设定祖先父子状态(公共) - loopSetAncestorParentStateCom
        LoopSetAncestorParentStateComRespDto loopSetAncestorParentStateComRespDto = null;
        LoopSetAncestorParentStateComReqDto loopSetAncestorParentStateComReqDto = new LoopSetAncestorParentStateComReqDto();
        if (reqDto != null) {
            loopSetAncestorParentStateComReqDto.setAssistNodeTypeObjectId(reqDto.getAssistNodeTypeObjectId());//sourceId:339441_1
            loopSetAncestorParentStateComReqDto.setAssistNodeTypeObjectCode(reqDto.getAssistNodeTypeObjectCode());//sourceId:339434_1
            loopSetAncestorParentStateComReqDto.setAssistNodeTypeCode(reqDto.getAssistNodeTypeCode());//sourceId:339439_1
            loopSetAncestorParentStateComReqDto.setObjectId(reqDto.getObjectId());//sourceId:339438_1
            loopSetAncestorParentStateComReqDto.setTimingTaskDispatchId(reqDto.getTimingTaskDispatchId());//sourceId:339435_1
        }

        /*D3-11循环设定祖先父子状态(公共)[3445]   */
        Assert.isNull(loopSetAncestorParentStateComReqDto.getAssistNodeTypeObjectId(), "B3-循环设定祖先目标父子状态（人工真实测试）-D3-11循环设定祖先父子状态(公共)-当前本级目标内容ID不能为空", false);
        Assert.isNull(loopSetAncestorParentStateComReqDto.getAssistNodeTypeObjectCode(), "B3-循环设定祖先目标父子状态（人工真实测试）-D3-11循环设定祖先父子状态(公共)-当前本级目标内容标识不能为空", false);
        Assert.isNull(loopSetAncestorParentStateComReqDto.getAssistNodeTypeCode(), "B3-循环设定祖先目标父子状态（人工真实测试）-D3-11循环设定祖先父子状态(公共)-当前本级目标内容类型编码不能为空", false);
        Assert.isNull(loopSetAncestorParentStateComReqDto.getObjectId(), "B3-循环设定祖先目标父子状态（人工真实测试）-D3-11循环设定祖先父子状态(公共)-评价模板ID不能为空", false);
        Assert.isNull(loopSetAncestorParentStateComReqDto.getTimingTaskDispatchId(), "B3-循环设定祖先目标父子状态（人工真实测试）-D3-11循环设定祖先父子状态(公共)-定时任务调度记录ID不能为空", false);
        loopSetAncestorParentStateComRespDto = fwAppTimingTaskClient.loopSetAncestorParentStateCom(loopSetAncestorParentStateComReqDto).getData();


        BffLoopSetTargetAncestorParentStateRespDto retData = new BffLoopSetTargetAncestorParentStateRespDto();


        return retData;
    }

    /**
     * B3-简易生成汇报任务（人工真实测试）[4647]
     * gen by moon at 10/2/2022, 9:25:10 AM
     */
    @Trace(operationName = "B3-简易生成汇报任务（人工真实测试）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffAddSimpleAddReportTaskRespDto addSimpleAddReportTask(BffAddSimpleAddReportTaskReqDto reqDto) {


        //步骤0: D3定时生成简易生成汇报任务 - timingAddSimpleAddReportTask
        TimingAddSimpleAddReportTaskRespDto timingAddSimpleAddReportTaskRespDto = null;
        TimingAddSimpleAddReportTaskReqDto timingAddSimpleAddReportTaskReqDto = new TimingAddSimpleAddReportTaskReqDto();


        /*D3定时生成简易生成汇报任务[3280]   */

        timingAddSimpleAddReportTaskRespDto = fwAppTimingTaskClient.timingAddSimpleAddReportTask(timingAddSimpleAddReportTaskReqDto).getData();


        BffAddSimpleAddReportTaskRespDto retData = new BffAddSimpleAddReportTaskRespDto();


        return retData;
    }

    /**
     * B3-删除指标基本信息（人工真实测试）[4649]
     * gen by moon at 9/22/2022, 1:09:08 AM
     */
    @Trace(operationName = "B3-删除指标基本信息（人工真实测试）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffDeleteTargetObjBasicInfoRespDto deleteTargetObjBasicInfo(BffDeleteTargetObjBasicInfoReqDto reqDto) {


        //步骤0: D3-3删除指标基本信息(公共) - deleteCom
        DeleteComRespDto deleteComRespDto = null;
        DeleteComReqDto deleteComReqDto = new DeleteComReqDto();
        deleteComReqDto.setTableTypeCode("OMS_TARGET_OBJECTIVE");//sourceId:339323_1
        if (reqDto != null) {
            deleteComReqDto.setEntityId(reqDto.getEntityId());//sourceId:339321_1
            deleteComReqDto.setSpaceId(reqDto.getSpaceId());//sourceId:339322_1
        }

        /*D3-3删除指标基本信息(公共)[3254]   */
        Assert.isNull(deleteComReqDto.getEntityId(), "B3-删除指标基本信息（人工真实测试）-D3-3删除指标基本信息(公共)-冗余内容表主键ID不能为空", false);
        Assert.isNull(deleteComReqDto.getTableTypeCode(), "B3-删除指标基本信息（人工真实测试）-D3-3删除指标基本信息(公共)-冗余内容表类型编码不能为空", false);
        Assert.isNull(deleteComReqDto.getSpaceId(), "B3-删除指标基本信息（人工真实测试）-D3-3删除指标基本信息(公共)-创建于空间ID不能为空", false);
        deleteComRespDto = fwAppTimingTaskClient.deleteCom(deleteComReqDto).getData();


        BffDeleteTargetObjBasicInfoRespDto retData = new BffDeleteTargetObjBasicInfoRespDto();


        return retData;
    }

    /**
     * B3-删除目标分类基本信息（人工真实测试）[4651]
     * gen by moon at 9/22/2022, 1:09:12 AM
     */
    @Trace(operationName = "B3-删除目标分类基本信息（人工真实测试）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffDeleteTargetCatBasicInfoRespDto deleteTargetCatBasicInfo(BffDeleteTargetCatBasicInfoReqDto reqDto) {


        //步骤0: D3-3删除目标分类基本信息(公共) - deleteTargetCatBasicInfoCom
        DeleteTargetCatBasicInfoComRespDto deleteTargetCatBasicInfoComRespDto = null;
        DeleteTargetCatBasicInfoComReqDto deleteTargetCatBasicInfoComReqDto = new DeleteTargetCatBasicInfoComReqDto();
        if (reqDto != null) {
//      deleteTargetCatBasicInfoComReqDto.setTargetCategoryId(reqDto.getTargetCategoryId());//sourceId:339362_1
//deleteTargetCatBasicInfoComReqDto.setSpaceId(reqDto.getSpaceId());//sourceId:339363_1
        }

        /*D3-3删除目标分类基本信息(公共)[3292]   */
//    Assert.isNull(deleteTargetCatBasicInfoComReqDto.getTargetCategoryId(),"B3-删除目标分类基本信息（人工真实测试）-D3-3删除目标分类基本信息(公共)-目标分类ID不能为空",false);
//Assert.isNull(deleteTargetCatBasicInfoComReqDto.getSpaceId(),"B3-删除目标分类基本信息（人工真实测试）-D3-3删除目标分类基本信息(公共)-创建于空间ID不能为空",false);
        deleteTargetCatBasicInfoComRespDto = fwAppTimingTaskClient.deleteTargetCatBasicInfoCom(deleteTargetCatBasicInfoComReqDto).getData();


        BffDeleteTargetCatBasicInfoRespDto retData = new BffDeleteTargetCatBasicInfoRespDto();


        return retData;
    }

    /**
     * B3-更新四棵树偏差天数等数据（人工真实测试）[4652]
     * gen by moon at 9/22/2022, 1:09:13 AM
     */
    @Trace(operationName = "B3-更新四棵树偏差天数等数据（人工真实测试）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffRefreshFourTreeDeviationDaysEtcRespDto refreshFourTreeDeviationDaysEtc(BffRefreshFourTreeDeviationDaysEtcReqDto reqDto) {


        //步骤0: D3-3更新四棵树偏差天数等数据(公共) - refreshFourTreeDeviationDaysEtcCom
        RefreshFourTreeDeviationDaysEtcComRespDto refreshFourTreeDeviationDaysEtcComRespDto = null;
        RefreshFourTreeDeviationDaysEtcComReqDto refreshFourTreeDeviationDaysEtcComReqDto = new RefreshFourTreeDeviationDaysEtcComReqDto();
        if (reqDto != null) {
            refreshFourTreeDeviationDaysEtcComReqDto.setEvaObjTargetCycleId(reqDto.getEvaObjTargetCycleId());//sourceId:339347_1
            refreshFourTreeDeviationDaysEtcComReqDto.setSpaceId(reqDto.getSpaceId());//sourceId:339348_1
        }

        /*D3-3更新四棵树偏差天数等数据(公共)[3361]   */
        Assert.isNull(refreshFourTreeDeviationDaysEtcComReqDto.getEvaObjTargetCycleId(), "B3-更新四棵树偏差天数等数据（人工真实测试）-D3-3更新四棵树偏差天数等数据(公共)-被评对象目标周期ID不能为空", false);
        Assert.isNull(refreshFourTreeDeviationDaysEtcComReqDto.getSpaceId(), "B3-更新四棵树偏差天数等数据（人工真实测试）-D3-3更新四棵树偏差天数等数据(公共)-创建于空间ID不能为空", false);
        refreshFourTreeDeviationDaysEtcComRespDto = fwAppTimingTaskClient.refreshFourTreeDeviationDaysEtcCom(refreshFourTreeDeviationDaysEtcComReqDto).getData();


        BffRefreshFourTreeDeviationDaysEtcRespDto retData = new BffRefreshFourTreeDeviationDaysEtcRespDto();


        return retData;
    }

    /**
     * B3-更新子周期阶段当前周期等（人工真实测试）[4653]
     * gen by moon at 5/3/2024, 11:45:49 PM
     */
    @Trace(operationName = "B3-更新子周期阶段当前周期等（人工真实测试）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffRefreshStageCurrentCycleEtcRespDto refreshStageCurrentCycleEtc(BffRefreshStageCurrentCycleEtcReqDto reqDto) {


        //步骤0: D3-3更新周期阶段当前周期等(公共) - refreshStageCurrentCycleEtcCom
        RefreshStageCurrentCycleEtcComRespDto refreshStageCurrentCycleEtcComRespDto = null;
        RefreshStageCurrentCycleEtcComReqDto refreshStageCurrentCycleEtcComReqDto = new RefreshStageCurrentCycleEtcComReqDto();
        refreshStageCurrentCycleEtcComReqDto.setIsSubCycle("TRUE");//sourceId:339366_1
        refreshStageCurrentCycleEtcComReqDto.setSystemCurrentTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME//sourceId:339369_1
        if (reqDto != null) {
            refreshStageCurrentCycleEtcComReqDto.setTargetCycleContentId(reqDto.getTargetCycleContentId());//SimpleFieldAssign//sourceId:1780047_1
            refreshStageCurrentCycleEtcComReqDto.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:1780048_1
            refreshStageCurrentCycleEtcComReqDto.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:339368_1
        }

        /*D3-3更新周期阶段当前周期等(公共)[3358]   */
        Assert.isNull(refreshStageCurrentCycleEtcComReqDto.getIsSubCycle(), "B3-更新子周期阶段当前周期等（人工真实测试）-D3-3更新周期阶段当前周期等(公共)-是否子周期不能为空", false);
        Assert.isNull(refreshStageCurrentCycleEtcComReqDto.getSystemCurrentTime(), "B3-更新子周期阶段当前周期等（人工真实测试）-D3-3更新周期阶段当前周期等(公共)-系统当前时间不能为空", false);
        Assert.isNull(refreshStageCurrentCycleEtcComReqDto.getTargetCycleContentId(), "B3-更新子周期阶段当前周期等（人工真实测试）-D3-3更新周期阶段当前周期等(公共)-关联目标内容ID不能为空", false);
        Assert.isNull(refreshStageCurrentCycleEtcComReqDto.getEvaluationTemplateId(), "B3-更新子周期阶段当前周期等（人工真实测试）-D3-3更新周期阶段当前周期等(公共)-冗余评价模板ID不能为空", false);
        Assert.isNull(refreshStageCurrentCycleEtcComReqDto.getSpaceId(), "B3-更新子周期阶段当前周期等（人工真实测试）-D3-3更新周期阶段当前周期等(公共)-创建于空间ID不能为空", false);
        refreshStageCurrentCycleEtcComRespDto = fwAppTimingTaskClient.refreshStageCurrentCycleEtcCom(refreshStageCurrentCycleEtcComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        BffRefreshStageCurrentCycleEtcRespDto retData = new BffRefreshStageCurrentCycleEtcRespDto();


        return retData;
    }

    /**
     * B3-更新末级周期阶段当前周期等（人工真实测试）[4654]
     * gen by moon at 5/3/2024, 11:45:52 PM
     */
    @Trace(operationName = "B3-更新末级周期阶段当前周期等（人工真实测试）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffRefreshStageEndCurrentCycleEtcRespDto refreshStageEndCurrentCycleEtc(BffRefreshStageEndCurrentCycleEtcReqDto reqDto) {


        //步骤0: D3-3更新周期阶段当前周期等(公共) - refreshStageCurrentCycleEtcCom
        RefreshStageCurrentCycleEtcComRespDto refreshStageCurrentCycleEtcComRespDto = null;
        RefreshStageCurrentCycleEtcComReqDto refreshStageCurrentCycleEtcComReqDto = new RefreshStageCurrentCycleEtcComReqDto();
        refreshStageCurrentCycleEtcComReqDto.setSystemCurrentTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME//sourceId:339383_1
        if (reqDto != null) {
            refreshStageCurrentCycleEtcComReqDto.setTargetCycleContentId(reqDto.getTargetCycleContentId());//SimpleFieldAssign//sourceId:1780051_1
            refreshStageCurrentCycleEtcComReqDto.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:1780052_1
            refreshStageCurrentCycleEtcComReqDto.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:339382_1
        }

        /*D3-3更新周期阶段当前周期等(公共)[3358]   */
        Assert.isNull(refreshStageCurrentCycleEtcComReqDto.getSystemCurrentTime(), "B3-更新末级周期阶段当前周期等（人工真实测试）-D3-3更新周期阶段当前周期等(公共)-系统当前时间不能为空", false);
        Assert.isNull(refreshStageCurrentCycleEtcComReqDto.getTargetCycleContentId(), "B3-更新末级周期阶段当前周期等（人工真实测试）-D3-3更新周期阶段当前周期等(公共)-关联目标内容ID不能为空", false);
        Assert.isNull(refreshStageCurrentCycleEtcComReqDto.getEvaluationTemplateId(), "B3-更新末级周期阶段当前周期等（人工真实测试）-D3-3更新周期阶段当前周期等(公共)-冗余评价模板ID不能为空", false);
        Assert.isNull(refreshStageCurrentCycleEtcComReqDto.getSpaceId(), "B3-更新末级周期阶段当前周期等（人工真实测试）-D3-3更新周期阶段当前周期等(公共)-创建于空间ID不能为空", false);
        refreshStageCurrentCycleEtcComRespDto = fwAppTimingTaskClient.refreshStageCurrentCycleEtcCom(refreshStageCurrentCycleEtcComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        BffRefreshStageEndCurrentCycleEtcRespDto retData = new BffRefreshStageEndCurrentCycleEtcRespDto();


        return retData;
    }

    /**
     * B3-更新任务逾期等数据（人工真实测试）[4655]
     * gen by moon at 9/22/2022, 1:09:19 AM
     */
    @Trace(operationName = "B3-更新任务逾期等数据（人工真实测试）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffRefreshTaskOverdueEtcRespDto refreshTaskOverdueEtc(BffRefreshTaskOverdueEtcReqDto reqDto) {


        //步骤0: D3-3更新任务逾期等数据(公共) - refreshTaskOverdueEtcCom
        RefreshTaskOverdueEtcComRespDto refreshTaskOverdueEtcComRespDto = null;
        RefreshTaskOverdueEtcComReqDto refreshTaskOverdueEtcComReqDto = new RefreshTaskOverdueEtcComReqDto();
        if (reqDto != null) {
            refreshTaskOverdueEtcComReqDto.setTaskId(reqDto.getTaskId());//sourceId:339428_1
            refreshTaskOverdueEtcComReqDto.setSpaceId(reqDto.getSpaceId());//sourceId:339429_1
//refreshTaskOverdueEtcComReqDto.setTimingTaskDispatchId(reqDto.getTimingTaskDispatchId());//sourceId:339430_1
        }

        /*D3-3更新任务逾期等数据(公共)[3359]   */
        Assert.isNull(refreshTaskOverdueEtcComReqDto.getTaskId(), "B3-更新任务逾期等数据（人工真实测试）-D3-3更新任务逾期等数据(公共)-任务ID不能为空", false);
        Assert.isNull(refreshTaskOverdueEtcComReqDto.getSpaceId(), "B3-更新任务逾期等数据（人工真实测试）-D3-3更新任务逾期等数据(公共)-创建于空间ID不能为空", false);
//Assert.isNull(refreshTaskOverdueEtcComReqDto.getTimingTaskDispatchId(),"B3-更新任务逾期等数据（人工真实测试）-D3-3更新任务逾期等数据(公共)-定时任务调度记录ID不能为空",false);
        refreshTaskOverdueEtcComRespDto = fwAppTimingTaskClient.refreshTaskOverdueEtcCom(refreshTaskOverdueEtcComReqDto).getData();


        BffRefreshTaskOverdueEtcRespDto retData = new BffRefreshTaskOverdueEtcRespDto();


        return retData;
    }

    /**
     * B3-2提交人工补偿异步调度任务(管理)[4177]
     * gen by moon at 5/3/2024, 11:45:45 PM
     */
    @Trace(operationName = "B3-2提交人工补偿异步调度任务(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffCommitHandRescueSlowTaskRespDto commitHandRescueSlowTask(BffCommitHandRescueSlowTaskReqDto reqDto) {


        //virtualUsage D3执行定时任务接收参数  14481
        ImplementTimingTaskAcceptParametersRespDto implementTimingTaskAcceptParametersRespDto = null;
        ImplementTimingTaskAcceptParametersReqDto implementTimingTaskAcceptParametersReqDto = new ImplementTimingTaskAcceptParametersReqDto();
        if (reqDto != null) {
            implementTimingTaskAcceptParametersReqDto.setTimingTaskDispatchId(reqDto.getTimingTaskDispatchId());//SimpleFieldAssign//sourceId:255838_1_14481
            implementTimingTaskAcceptParametersReqDto.setDispatchActionTypeCode(reqDto.getDispatchActionTypeCode());//SimpleFieldAssign//sourceId:255834_1_14481
            implementTimingTaskAcceptParametersReqDto.setObjectTypeCode(reqDto.getObjectTypeCode());//SimpleFieldAssign//sourceId:255839_1_14481
            implementTimingTaskAcceptParametersReqDto.setStandbyField1(reqDto.getStandbyField1());//SimpleFieldAssign//sourceId:255922_1_14481
            implementTimingTaskAcceptParametersReqDto.setObjectId(reqDto.getObjectId());//SimpleFieldAssign//sourceId:255835_1_14481
            implementTimingTaskAcceptParametersReqDto.setAddRuleInfoTypeCode(reqDto.getAddRuleInfoTypeCode());//SimpleFieldAssign//sourceId:255841_1_14481
            implementTimingTaskAcceptParametersReqDto.setAddRuleInfoId(reqDto.getAddRuleInfoId());//SimpleFieldAssign//sourceId:255836_1_14481
            implementTimingTaskAcceptParametersReqDto.setAutoPlanTime(reqDto.getAutoPlanTime());//SimpleFieldAssign//sourceId:255837_1_14481
            implementTimingTaskAcceptParametersReqDto.setOperationInductionId(reqDto.getOperationInductionId());//SimpleFieldAssign//sourceId:255842_1_14481
            implementTimingTaskAcceptParametersReqDto.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:255843_1_14481
            implementTimingTaskAcceptParametersReqDto.setAppId(reqDto.getAppId());//SimpleFieldAssign//sourceId:255844_1_14481
        }

        /*D3执行定时任务接收参数[3303]   */
        Assert.isNull(implementTimingTaskAcceptParametersReqDto.getTimingTaskDispatchId(), "B3-2提交人工补偿异步调度任务(管理)-D3执行定时任务接收参数-定时任务调度记录ID不能为空", false);
        Assert.isNull(implementTimingTaskAcceptParametersReqDto.getDispatchActionTypeCode(), "B3-2提交人工补偿异步调度任务(管理)-D3执行定时任务接收参数-任务调度的行为类型编码不能为空", false);
        Assert.isNull(implementTimingTaskAcceptParametersReqDto.getObjectTypeCode(), "B3-2提交人工补偿异步调度任务(管理)-D3执行定时任务接收参数-归属对象类型编码不能为空", false);
        Assert.isNull(implementTimingTaskAcceptParametersReqDto.getObjectId(), "B3-2提交人工补偿异步调度任务(管理)-D3执行定时任务接收参数-归属对象内容ID不能为空", false);
        Assert.isNull(implementTimingTaskAcceptParametersReqDto.getOperationInductionId(), "B3-2提交人工补偿异步调度任务(管理)-D3执行定时任务接收参数-操作人就职记录ID不能为空", false);
        Assert.isNull(implementTimingTaskAcceptParametersReqDto.getSpaceId(), "B3-2提交人工补偿异步调度任务(管理)-D3执行定时任务接收参数-创建于空间ID不能为空", false);
        Assert.isNull(implementTimingTaskAcceptParametersReqDto.getAppId(), "B3-2提交人工补偿异步调度任务(管理)-D3执行定时任务接收参数-创建于联盟应用ID不能为空", false);
        implementTimingTaskAcceptParametersRespDto = fwAppDivineDataClient.implementTimingTaskAcceptParameters(implementTimingTaskAcceptParametersReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        if ((reqDto != null && reqDto.getDispatchActionTypeCode() != null && reqDto.getDispatchActionTypeCode().equals("DISPATCH_ADD_REPORT_TASK"))) {
            //if(B3-2提交人工补偿异步调度任务(管理).任务调度的行为类型编码 等于 调度生成汇报任务)  14482

            GenerateTargetReportTasksComRespDto generateTargetReportTasksComRespDto = null;
            GenerateTargetReportTasksComReqDto generateTargetReportTasksComReqDto = new GenerateTargetReportTasksComReqDto();
            if (reqDto != null) {
                generateTargetReportTasksComReqDto.setTimingTaskDispatchId(reqDto.getTimingTaskDispatchId());//SimpleFieldAssign//sourceId:356771_1_14483
                generateTargetReportTasksComReqDto.setEvaObjTargetCycleId(reqDto.getObjectId());//SimpleFieldAssign//sourceId:255845_1_14483
                generateTargetReportTasksComReqDto.setExecuteCycleStageId(reqDto.getAddRuleInfoId());//SimpleFieldAssign//sourceId:680505_1_14483
                generateTargetReportTasksComReqDto.setCompareTime(reqDto.getAutoPlanTime());//SimpleFieldAssign//sourceId:255848_1_14483
                generateTargetReportTasksComReqDto.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:255846_1_14483
            }

            /*D3生成目标内容汇报任务(公共)[3293]   */
            Assert.isNull(generateTargetReportTasksComReqDto.getTimingTaskDispatchId(), "B3-2提交人工补偿异步调度任务(管理)-D3生成目标内容汇报任务(公共)-定时任务调度记录ID不能为空", false);
            Assert.isNull(generateTargetReportTasksComReqDto.getEvaObjTargetCycleId(), "B3-2提交人工补偿异步调度任务(管理)-D3生成目标内容汇报任务(公共)-被评对象目标周期ID不能为空", false);
            Assert.isNull(generateTargetReportTasksComReqDto.getExecuteCycleStageId(), "B3-2提交人工补偿异步调度任务(管理)-D3生成目标内容汇报任务(公共)-执行周期阶段ID不能为空", false);
            Assert.isNull(generateTargetReportTasksComReqDto.getCompareTime(), "B3-2提交人工补偿异步调度任务(管理)-D3生成目标内容汇报任务(公共)-比较时间不能为空", false);
            Assert.isNull(generateTargetReportTasksComReqDto.getSpaceId(), "B3-2提交人工补偿异步调度任务(管理)-D3生成目标内容汇报任务(公共)-创建于空间ID不能为空", false);
            generateTargetReportTasksComRespDto = fwAppTaskClient.generateTargetReportTasksCom(generateTargetReportTasksComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


//processBranchName:正常结束 ,processBranchId:14484

        } else if ((reqDto != null && reqDto.getDispatchActionTypeCode() != null && reqDto.getDispatchActionTypeCode().equals("STAGE_CURRENT_CYCLE_ETC"))) {
            //elseif(B3-2提交人工补偿异步调度任务(管理).任务调度的行为类型编码 等于 调度更新执行周期阶段当前周期等（选用）)  14497

            RefreshAllTempDeviationDaysAndCurrentCycleComRespDto refreshAllTempDeviationDaysAndCurrentCycleComRespDto = null;
            RefreshAllTempDeviationDaysAndCurrentCycleComReqDto refreshAllTempDeviationDaysAndCurrentCycleComReqDto = new RefreshAllTempDeviationDaysAndCurrentCycleComReqDto();
            if (reqDto != null) {
                refreshAllTempDeviationDaysAndCurrentCycleComReqDto.setTimingTaskDispatchId(reqDto.getTimingTaskDispatchId());//SimpleFieldAssign//sourceId:1780291_1_68069
                refreshAllTempDeviationDaysAndCurrentCycleComReqDto.setTargetCycleContentId(reqDto.getObjectId());//SimpleFieldAssign//sourceId:1780295_1_68069
                refreshAllTempDeviationDaysAndCurrentCycleComReqDto.setEvaluationTemplateId(reqDto.getAddRuleInfoId());//SimpleFieldAssign//sourceId:1780293_1_68069
                refreshAllTempDeviationDaysAndCurrentCycleComReqDto.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:1780294_1_68069
            }

            /*D3更新全评价模板目标周期偏差天数及当前执行周期(公共)[9509]   */
            Assert.isNull(refreshAllTempDeviationDaysAndCurrentCycleComReqDto.getTimingTaskDispatchId(), "B3-2提交人工补偿异步调度任务(管理)-D3更新全评价模板目标周期偏差天数及当前执行周期(公共)-定时任务调度记录ID不能为空", false);
            Assert.isNull(refreshAllTempDeviationDaysAndCurrentCycleComReqDto.getTargetCycleContentId(), "B3-2提交人工补偿异步调度任务(管理)-D3更新全评价模板目标周期偏差天数及当前执行周期(公共)-关联目标内容ID不能为空", false);
            Assert.isNull(refreshAllTempDeviationDaysAndCurrentCycleComReqDto.getEvaluationTemplateId(), "B3-2提交人工补偿异步调度任务(管理)-D3更新全评价模板目标周期偏差天数及当前执行周期(公共)-冗余评价模板ID不能为空", false);
            Assert.isNull(refreshAllTempDeviationDaysAndCurrentCycleComReqDto.getSpaceId(), "B3-2提交人工补偿异步调度任务(管理)-D3更新全评价模板目标周期偏差天数及当前执行周期(公共)-创建于空间ID不能为空", false);
            refreshAllTempDeviationDaysAndCurrentCycleComRespDto = fwAppTimingTaskClient.refreshAllTempDeviationDaysAndCurrentCycleCom(refreshAllTempDeviationDaysAndCurrentCycleComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


//processBranchName:正常结束 ,processBranchId:14500

        } else if ((reqDto != null && reqDto.getDispatchActionTypeCode() != null && reqDto.getDispatchActionTypeCode().equals("TASK_OVERDUE_ETC"))) {
            //elseif(B3-2提交人工补偿异步调度任务(管理).任务调度的行为类型编码 等于 调度更新任务逾期等数据)  14501

            RefreshTaskOverdueEtcComRespDto refreshTaskOverdueEtcComRespDto = null;
            RefreshTaskOverdueEtcComReqDto refreshTaskOverdueEtcComReqDto = new RefreshTaskOverdueEtcComReqDto();
            if (reqDto != null) {
                refreshTaskOverdueEtcComReqDto.setTaskId(reqDto.getObjectId());//SimpleFieldAssign//sourceId:255869_1_14502
                refreshTaskOverdueEtcComReqDto.setSpaceId(reqDto.getSpaceId());//SimpleFieldAssign//sourceId:255870_1_14502
            }

            /*D3-3更新汇报任务状态相关(公共)[3359]   */
            Assert.isNull(refreshTaskOverdueEtcComReqDto.getTaskId(), "B3-2提交人工补偿异步调度任务(管理)-D3-3更新汇报任务状态相关(公共)-任务ID不能为空", false);
            Assert.isNull(refreshTaskOverdueEtcComReqDto.getSpaceId(), "B3-2提交人工补偿异步调度任务(管理)-D3-3更新汇报任务状态相关(公共)-创建于空间ID不能为空", false);
            refreshTaskOverdueEtcComRespDto = fwAppTimingTaskClient.refreshTaskOverdueEtcCom(refreshTaskOverdueEtcComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


//processBranchName:正常结束 ,processBranchId:14503

        } else if ((reqDto != null && reqDto.getDispatchActionTypeCode() != null && reqDto.getDispatchActionTypeCode().equals("DISATCH_TARGET_ANCESTOR_TASK"))) {
            //elseif(B3-2提交人工补偿异步调度任务(管理).任务调度的行为类型编码 等于 调度生成设定祖先目标父子状态调度任务)  14504

            LoopSetAncestorParentStateComRespDto loopSetAncestorParentStateComRespDto = null;
            LoopSetAncestorParentStateComReqDto loopSetAncestorParentStateComReqDto = new LoopSetAncestorParentStateComReqDto();
            if (reqDto != null) {
                loopSetAncestorParentStateComReqDto.setAssistNodeTypeObjectId(reqDto.getObjectId());//SimpleFieldAssign//sourceId:255879_1_14505
                loopSetAncestorParentStateComReqDto.setTimingTaskDispatchId(reqDto.getTimingTaskDispatchId());//SimpleFieldAssign//sourceId:255873_1_14505
                loopSetAncestorParentStateComReqDto.setAssistNodeTypeObjectCode(reqDto.getStandbyField1());//SimpleFieldAssign//sourceId:363052_1_14505
                loopSetAncestorParentStateComReqDto.setAssistNodeTypeCode(reqDto.getObjectTypeCode());//SimpleFieldAssign//sourceId:363053_1_14505
                loopSetAncestorParentStateComReqDto.setObjectTypeCode(reqDto.getAddRuleInfoTypeCode());//SimpleFieldAssign//sourceId:368401_1_14505
                loopSetAncestorParentStateComReqDto.setObjectId(reqDto.getAddRuleInfoId());//SimpleFieldAssign//sourceId:363050_1_14505
            }

            /*D3-11循环设定祖先父子状态(公共)[3445]   */
            Assert.isNull(loopSetAncestorParentStateComReqDto.getAssistNodeTypeObjectId(), "B3-2提交人工补偿异步调度任务(管理)-D3-11循环设定祖先父子状态(公共)-当前本级目标内容ID不能为空", false);
            Assert.isNull(loopSetAncestorParentStateComReqDto.getTimingTaskDispatchId(), "B3-2提交人工补偿异步调度任务(管理)-D3-11循环设定祖先父子状态(公共)-定时任务调度记录ID不能为空", false);
            Assert.isNull(loopSetAncestorParentStateComReqDto.getAssistNodeTypeObjectCode(), "B3-2提交人工补偿异步调度任务(管理)-D3-11循环设定祖先父子状态(公共)-当前本级目标内容标识不能为空", false);
            Assert.isNull(loopSetAncestorParentStateComReqDto.getAssistNodeTypeCode(), "B3-2提交人工补偿异步调度任务(管理)-D3-11循环设定祖先父子状态(公共)-当前本级目标内容类型编码不能为空", false);
            Assert.isNull(loopSetAncestorParentStateComReqDto.getObjectTypeCode(), "B3-2提交人工补偿异步调度任务(管理)-D3-11循环设定祖先父子状态(公共)-归属对象类型编码不能为空", false);
            Assert.isNull(loopSetAncestorParentStateComReqDto.getObjectId(), "B3-2提交人工补偿异步调度任务(管理)-D3-11循环设定祖先父子状态(公共)-归属对象内容ID不能为空", false);
            loopSetAncestorParentStateComRespDto = fwAppTimingTaskClient.loopSetAncestorParentStateCom(loopSetAncestorParentStateComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


//processBranchName:正常结束 ,processBranchId:14506

        }
        BffCommitHandRescueSlowTaskRespDto retData = new BffCommitHandRescueSlowTaskRespDto();


        return retData;
    }

    /**
     * B3-更新四棵树偏差天数等调度（人工真实测试）[4728]
     * gen by moon at 9/28/2022, 7:15:28 AM
     */
    @Trace(operationName = "B3-更新四棵树偏差天数等调度（人工真实测试）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffRefreshFourTreeDeviationDaysDispatchRespDto refreshFourTreeDeviationDaysDispatch(BffRefreshFourTreeDeviationDaysDispatchReqDto reqDto) {


        //步骤0: D3-3更新四棵树偏差天数等调度(公共) - refreshFourTreeDeviationDaysDispatchCom
        RefreshFourTreeDeviationDaysDispatchComRespDto refreshFourTreeDeviationDaysDispatchComRespDto = null;
        RefreshFourTreeDeviationDaysDispatchComReqDto refreshFourTreeDeviationDaysDispatchComReqDto = new RefreshFourTreeDeviationDaysDispatchComReqDto();
        if (reqDto != null) {
            refreshFourTreeDeviationDaysDispatchComReqDto.setDispatchActionTypeCode(reqDto.getDispatchActionTypeCode());//sourceId:352265_1
            refreshFourTreeDeviationDaysDispatchComReqDto.setObjectTypeCode(reqDto.getObjectTypeCode());//sourceId:352266_1
            refreshFourTreeDeviationDaysDispatchComReqDto.setDispatchActionTypeCode(reqDto.getDispatchActionTypeCode());//sourceId:352267_1
        }

        /*D3-3更新四棵树偏差天数等调度(公共)[3357]   */
        Assert.isNull(refreshFourTreeDeviationDaysDispatchComReqDto.getDispatchActionTypeCode(), "B3-更新四棵树偏差天数等调度（人工真实测试）-D3-3更新四棵树偏差天数等调度(公共)-任务调度的行为类型编码不能为空", false);
        Assert.isNull(refreshFourTreeDeviationDaysDispatchComReqDto.getObjectTypeCode(), "B3-更新四棵树偏差天数等调度（人工真实测试）-D3-3更新四棵树偏差天数等调度(公共)-归属对象类型编码不能为空", false);
        Assert.isNull(refreshFourTreeDeviationDaysDispatchComReqDto.getDispatchActionTypeCode(), "B3-更新四棵树偏差天数等调度（人工真实测试）-D3-3更新四棵树偏差天数等调度(公共)-任务调度的行为类型编码不能为空", false);
        refreshFourTreeDeviationDaysDispatchComRespDto = fwAppTimingTaskClient.refreshFourTreeDeviationDaysDispatchCom(refreshFourTreeDeviationDaysDispatchComReqDto).getData();


        BffRefreshFourTreeDeviationDaysDispatchRespDto retData = new BffRefreshFourTreeDeviationDaysDispatchRespDto();


        return retData;
    }

    /**
     * B3执行启用空间长生调度MQ(管理)[5097]
     * gen by moon at 5/14/2023, 5:06:00 PM
     */
    @Trace(operationName = "B3执行启用空间长生调度MQ(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffImplementEnableSpaceEverYoungDispatchMqRespDto implementEnableSpaceEverYoungDispatchMq(BffImplementEnableSpaceEverYoungDispatchMqReqDto reqDto) {


        //步骤0: D3执行启用空间长生调度MQ(公共) - implementEnableSpaceEverYoungDispatchMqCom
        ImplementEnableSpaceEverYoungDispatchMqComRespDto implementEnableSpaceEverYoungDispatchMqComRespDto = null;
        ImplementEnableSpaceEverYoungDispatchMqComReqDto implementEnableSpaceEverYoungDispatchMqComReqDto = new ImplementEnableSpaceEverYoungDispatchMqComReqDto();
        implementEnableSpaceEverYoungDispatchMqComReqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:600743_1

        /*D3执行启用空间长生调度MQ(公共)[5092]   */
        Assert.isNull(implementEnableSpaceEverYoungDispatchMqComReqDto.getSpaceId(), "B3执行启用空间长生调度MQ(管理)-D3执行启用空间长生调度MQ(公共)-空间ID不能为空", false);
        implementEnableSpaceEverYoungDispatchMqComRespDto = fwAppTimingTaskClient.implementEnableSpaceEverYoungDispatchMqCom(implementEnableSpaceEverYoungDispatchMqComReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        BffImplementEnableSpaceEverYoungDispatchMqRespDto retData = new BffImplementEnableSpaceEverYoungDispatchMqRespDto();


        return retData;
    }

    /**
     * B3执行分析目标内容情况(管理)[6824]
     * gen by moon at 5/18/2023, 11:06:51 PM
     */
    @Trace(operationName = "B3执行分析目标内容情况(管理)")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    public BffImplementAnalyseDogBoneResidueRespDto implementAnalyseDogBoneResidue(BffImplementAnalyseDogBoneResidueReqDto reqDto) {


        ImplementAnalyseDogBoneResidueRespDto implementAnalyseDogBoneResidueRespDto_1 = null;
//步骤0: D3执行分析狗骨头剩余情况 - implementAnalyseDogBoneResidue
        ImplementAnalyseDogBoneResidueRespDto implementAnalyseDogBoneResidueRespDto = null;
        ImplementAnalyseDogBoneResidueReqDto implementAnalyseDogBoneResidueReqDto = new ImplementAnalyseDogBoneResidueReqDto();
        implementAnalyseDogBoneResidueReqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:958006_1

        /*D3执行分析狗骨头剩余情况[6823]   */
        Assert.isNull(implementAnalyseDogBoneResidueReqDto.getSpaceId(), "B3执行分析目标内容情况(管理)-D3执行分析狗骨头剩余情况-空间ID不能为空", false);
        implementAnalyseDogBoneResidueRespDto = fwAppTimingTaskClient.implementAnalyseDogBoneResidue(implementAnalyseDogBoneResidueReqDto).getData()/*vcase invoke 跨dubbo调用;*/;


        implementAnalyseDogBoneResidueRespDto_1 = implementAnalyseDogBoneResidueRespDto;

        BffImplementAnalyseDogBoneResidueRespDto retData = new BffImplementAnalyseDogBoneResidueRespDto();
        if (implementAnalyseDogBoneResidueRespDto_1 != null) {
            retData.setUnfinishedNum(implementAnalyseDogBoneResidueRespDto_1.getUnfinishedNum());//SimpleFieldAssign//sourceId:958008_1
        }


        return retData;
    }
    //
}
